﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/pages/Menu.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_pages_sustentabilidade_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Titulo" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Pagina" Runat="Server">

    <div class="magin-auto cadastro">
        <fieldset>
                <legend><label>Lista de Sustentabilidade</label></legend>
                    <div class="botao_top">
                        <asp:HyperLink ID="HyperLink1" runat="server"  CssClass="sem_borda texto_cinza" 
                                       NavigateUrl="~/admin/pages/sustentabilidade/Novo.aspx" >
                            <asp:Image ID="ImageButton2" runat="server"  CssClass="sem_borda"
                                ImageUrl="~/admin/Images/bt_add.png"
                                 ToolTip="Novo" />
                            Novo
                        </asp:HyperLink>
                    </div>
                        <asp:GridView ID="GridViewSust" runat="server" AllowPaging="True" 
                            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                            BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                            DataKeyNames="ID" DataSourceID="EntityDataSource1" 
                            onselectedindexchanged="SelectGrid"
                            CssClass="GridViewStyle" GridLines="None">
                            <Columns>
                                <asp:BoundField DataField="Titulo" HeaderText="Titulo" SortExpression="Titulo" />
           
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" ToolTip="Editar" CausesValidation="False" 
                                            CommandName="Select" >
                                            <asp:Image ID="Image1" runat="server" BorderWidth="0px" ImageUrl="~/admin/css/images/iconEdit.png"/>
                                        </asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                         <asp:LinkButton ID="LinkButton2" runat="server" CssClass="sem_borda" CausesValidation="False" 
                                                        CommandName='<%# Eval("ID") %>'
                                                        OnCommand="Deletar" 
                                                        OnClientClick='<%# Eval("ID", "return confirm(\"Deseja mesmo apagar o registro?\")") %>'>
                                     <asp:Image ID="Image2" runat="server"  BorderWidth="0px" ImageUrl="~/admin/css/images/icon_excluir.png"/>
                                </asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                            <HeaderStyle CssClass="HeaderStyle" />
                            <PagerStyle CssClass="PagerStyle" HorizontalAlign="Center" />
                            <RowStyle CssClass="RowStyle" /> 
                            <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                            <SelectedRowStyle CssClass="SelectedRowStyle" />
                            <EditRowStyle CssClass="EditRowStyle" />
                            <AlternatingRowStyle CssClass="AltRowStyle" />
                            <SortedAscendingCellStyle BackColor="#FEFCEB" />
                            <SortedAscendingHeaderStyle BackColor="#AF0101" />
                            <SortedDescendingCellStyle BackColor="#F6F0C0" />
                            <SortedDescendingHeaderStyle BackColor="#7E0000" />
                        </asp:GridView>
                        <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                            ConnectionString="name=guedesEntities" DefaultContainerName="guedesEntities" 
                            EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
                            EnableUpdate="True" EntitySetName="sust" EntityTypeFilter="sust">
                        </asp:EntityDataSource>
                <div class="voltar">
                    <asp:LinkButton ID="lkVoltar" runat="server" CssClass="texto_cinza" PostBackUrl="~/admin/pages/Default.aspx">home</asp:LinkButton>
                </div>
           </fieldset>
    </div>
</asp:Content>

